package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 * @author spt
 * @description 预约设置DAO
 * @date 2019/9/29
 **/
@Mapper
public interface OrderSettingDao {
    /**
     * 根据时间查询
     *
     * @param orderDate
     * @return
     */
    OrderSetting selectByOrderDate(@Param("orderDate") Date orderDate);

    /**
     * 根据ID更新NUmber
     *
     * @param id
     * @param number
     */
    void updateNumberById(@Param("id") Integer id, @Param("number") int number);

    /**
     * 插入
     *
     * @param orderSetting
     */
    void insert(OrderSetting orderSetting);

    //根据时间查询预约
    List<OrderSetting> selectByOrderDateRange(LocalDate startDate, LocalDate endDate);

    /**
     * 根据id更新已预约人数
     *
     * @param id
     * @param reservations
     */
    void updateReservationsById(@Param("id") Integer id, @Param("reservations") int reservations);
}